<template>
  <!-- <div> -->
  <Dividelr>
    <template #left>
      <LBG :buttonList="lbuttonList" />
    </template>
    <template #right>
      <!-- <router-view /> -->
      <slot/>
    </template>
  </Dividelr>
  <!-- </div> -->
</template>
<script setup>
import { ref, onMounted, defineOptions, nextTick } from "vue";
import useTagStore from "@/stores/tagList";
const tagStore = useTagStore();
import Dividelr from "@/layout/components/dividelr.vue";
import LBG from "@/components/ButtonGroup/leftButtonGroup.vue";
import router from "@/router";
defineOptions({ name: "documentCom" });
// 按钮列表
const lbuttonList = ref([
  {
    label: "流程模板库",
    icon: "el-icon-folder",
    type: "b2",
    active: true,
    component: "ProcessTemplateLib",
    path: "/process/processtemplateLib",
    onClick: (e) => {
      selectFunction("流程模板库", "/process/processtemplateLib");
      console.log(e.target);
      // e.target.parentNode.parentNode.
    },
  },
  {
    label: "回收站",
    icon: "IconRecycleBin",
    type: "b2",
    component: "ProcessBin",
    path: "/process/processbin",
    onClick: (e) => {
      selectFunction("回收站", "/process/processbin");
      console.log(e.target);
    },
  },
]);
// const documentPage = ref(MyFolder);

const selectFunction = (name, path) => {
  tagStore.refreshTagList(
    { name: null, breadcrumbName: null, fullPath: null },
    { name: path, breadcrumbName: name, fullPath: path }
  );
  router.replace({ path });
  console.log(name, path, tagStore.tagList, "38921739193");
};
const searchCallBack = (word, time) => {
  console.log("搜索回调", word, time);
};
onMounted(() => {
  console.log("文档管理layout挂载完成");
});
</script>
